export default {
  facets: [{
    code: 'node',
    name: '节点配置',
    type: 'dev',
    model: {
      path: '/service/{app}/list',
      events: [{
        condition: '${code}!=""',
        'hiddens': [
          'memo'
        ]
      }, {
        condition: '${facets.name}==1',
        'hiddens': [
          'type'
        ]
      }],
      code: 'node',
      fieldset: [{
        code: 'a1',
        name: '1',
        collapse: false
      }],
      fields: [{
        code: 'code',
        type: 'code',
        name: '编码',
        fieldset: 'a1',
        def_value: '${parent.id}',
        scope: 'param',
        param: {
          range: true
        },
        rangeset: {
        },
        tip: '800'
      }, {
        code: 'name',
        type: 'ref',
        tpl: '<badge_case_process>{name}</badge_case_process>',
        rangeset: {
          code: 'db_actuator',
          mapping: {
            code: 'id'
          }
        },
        fieldset: 'a2',
        name: '名称',
        tip: '890000'
      }, {
        code: 'enable_publish',
        name: '已发布',
        type: 'code',
        default_value: '11',
        editable: true
      }, {
        code: 'memo',
        type: 'money',
        required: false,
        name: '备注'

      }, {
        code: 'type',
        name: '类型',
        fieldset: 'a3',
        type: 'date',
        param: {
          range: true
        }
      }],
      actions: [{
        code: 'add',
        type: 'add',
        dev: true,
        icon: 'plus'
      }, {
        'code': 'drill_deduct',
        'name': '划扣明细',
        'type': 'drill',
        'locate': 'inline',
        'param': {
          'bill_code': 'role',
          'filter_mapping': {
            'id': 'name_play',
            'org_id': 'org_id'
          }
        }
      }, {
        code: 'list_editor',
        type: 'list_editor',
        param: {
          path_model: '/service/cs/model',
          path_data: '/service/cs/list'
        }
      }, {
        code: 'edit',
        type: 'edit',
        dev: true,
        scope: 'data',
        icon: 'edit',
        param: {
          path_find: '/service/cs/t2',
          inner_trigger: 't1;add'
        }
      }, {
        'type': 'case_distribute',
        'path': '/service/cs/dataset/data/db_dataset',
        'locate': 'right',
        'param': {
          'select_rangeset': 'db_dataset'
        }
      }, {
        code: 't1',
        type: 'process',
        dev: true,
        scope: 'rows',
        name: '处理',
        path: '/service/{app}/nodes',
        param: {
          result_show: true,
          result_show_time: true
        }
      }],
      actions1: [{
        type: 'apply_confirm',
        param: {
          list_bill_code: 'apply_confirm',
          form_bill_code: 'apply_confirm'
        }
      }, {
        type: 'dev',
        name: '测试用'
      }, {
        type: 'drill',
        dev: true,
        locate: 'hidden',
        param: {
          bill_code: 'entity',
          filter_mapping: {
            code: 'code'
          }
        }
      }, {
        type: 'webcall',
        dev: true,
        param: {
          // field_phone: 'name',
          path_phone: 'service/{app}/call',
          on_loss: 'drill',
          on_get: 'edit'
        },
        locate: 'inline',
        name: '联系债权人'
      }, {
        type: 'add',
        dev: true,
        icon: 'plus',
        scope: 'data',
        param: {
          /*bill_code: 'collect_log'*/
        }
      }, {
        type: 'edit',
        dev: true,
        param: {
          path_find: '/service/t2?id={id}',
          trigger: 'dbclick'
        }
      }, {
        code: 'add',
        type: 'add',
        icon: 'plus',
        name: '新增节点',
        param: {
          path_data: '/service/t1',
          path_submit: '/service/{app}/nf/model',
          size: 'l',
          col: 2
        }
      }, {
        type: 'case_detail',
        name: '详情',
        locate: 'inline',
        param: {
          path_find: '/service/{app}/nf/model/{code}',
          path_submit: '/service/{app}/nf/model',
          size: 'l',
          col: 2
        }
      }, {
        code: 'nodeView',
        type: 'nodeView',
        name: '预览',
        locate: 'inline',
        param: {
          path_find: '/service/{app}/nf/model/{code}'
        }
      }, {
        code: 'delete',
        type: 'delete',
        path: '/service/{app}/nf/model',
        scope: 'rows',
        name: '删除'
      }, {
        code: 'nodePublish',
        type: 'nodePublish',
        locate: 'inline',
        icon: 'forward',
        name: '生成节点',
        path: 'service/{app}/nf/model/exp',
        param: {
          condition: '!data.enable_publish'
        }
      }, {
        code: 'recall',
        type: 'process',
        locate: 'inline',
        icon: 'reply',
        name: '撤回节点',
        path: 'service/{app}/nf/model/recall/{id}',
        param: {
          condition: 'data.enable_publish'
        }
      },
        {
          code: 'publish',
          type: 'process',
          path: 'service/{app}/nf/model/pubilsh',
          scope: 'rows',
          name: '发布'
        },
        {
          code: 'seal',
          type: 'process',
          path: 'pf/nf/model/seal',
          scope: 'rows',
          name: '停用'
        }, {
          type: 'list_editor',
          name: '编辑参数',
          param: {
            path_model: 'service/{app}/testModel',
            path_data: 'service/dw/nf/models'

          }
        }
      ],
      slaves: [{
        code: 'facets',
        enable_attachment: true,
        name: '节点内容',
        fields: [{
          code: 'ref',
          name: 'ref',
          type: 'ref',
          rangeset: 'db_account',
          param: {
            mapping: 'a=1;b=2;c=${name};d=${parent.name}'
          }
        }, {
          code: 'name',
          name: '名称',
          type: 'code',
          rangeset: {
            min: '${parent.code}'
          }
        }, {
          code: 'type',
          name: '类型',
          type: 'code'
        }, {
          code: 'bill_code',
          name: '单据',
          type: 'ref',
          rangeset: {
            path: '/service/{app}/bill/models?disable_db=false',
            key: 'code'
          }
        }],
        actions: [{
          code: 'add',
          type: 'add',
          name: '添加单据1',
          param: {
            local: true,
            size: 'm'
          }
        }, /*{
          code: 'delete',
          type: 'delete',
          locate: 'box',
          path: '/x'
        }, {
          code: 'upload',
          param: {
            module: 'upload'
          }
        }, {
          code: 'view',
          type: 'view',
          name: 'view',
          param: {

          }
        },
         */ {
          code: 'edit',
          type: 'edit',
          name: '编辑',
          locate: 'box',
          scope: 'data',
          param: {
            local: true,
            size: 'm'
          }
        }
        ]
      }]
    }
  }, {
    code: 'bill',
    name: '单据配置',
    model: {
      path: '/service/{app}/bill/models?disable_db=false',
      fields: [{
        code: 'code',
        type: 'code',
        name: '编码'
      }, {
        code: 'name',
        type: 'code',
        name: '名称'
      }, {
        code: 'memo',
        type: 'memo',
        name: '备注'
      }, {
        code: 'status',
        type: 'state',
        name: '状态',
        cardpos: 0
      }],
      slaves: [{
        code: 'structs',
        name: '实体结构',
        fields: [{
          code: 'code',
          name: '编码',
          type: 'code'
        }, {
          code: 'name',
          name: '名称',
          type: 'code'
        }, {
          code: 'type',
          name: '类型',
          type: 'code'
        }, {
          code: 'enable_main',
          name: '主表',
          type: 'bool'
        }, {
          code: 'ref_type',
          type: 'state',
          name: '子表关系',
          rangeset: 'direct:direct@bridge:bridge@weak:weak'
        }, {
          code: 'memo',
          name: '备注',
          type: 'memo'
        }],
        actions: [{
          code: 'add',
          type: 'add',
          name: '添加表结构',
          param: {
            local: true,
            col: 2,
            size: 'max'
          }
        }, {
          code: 'delete',
          type: 'delete',
          path: '/delete'
        }, {
          code: 'addEntity',
          type: 'billAddEnitty',
          name: '添加实体',
          param: {
            local: true,
            col: 2,
            size: 'max'
          }
        },
          {
            code: 'setRm',
            type: 'setRm',
            name: '关联关系',
            locate: 'inline',
            param: {
              condition: '${!data.enable_main}'
            }
          },
          {
            code: 'edit',
            type: 'edit',
            name: '编辑',
            locate: 'inline',
            param: {
              local: true,
              col: 2,
              size: 'max'
            }
          }
        ],
        slaves: [{
          code: 'fields',
          type: 'editor',
          name: '实体字段',
          fields: [{
            name: '编码',
            code: 'code',
            type: 'code'
          }, {
            name: '名称',
            code: 'name',
            type: 'code'
          }, {
            name: '类型',
            code: 'type',
            type: 'code',
            rangeset: ['pk', 'code', 'date', 'timestamp', 'memo', 'money', 'seriescode', 'stat', 'clob', 'integer', 'ref', 'json']
          }, {
            name: '作用范围',
            code: 'scope',
            type: 'state',
            rangeset: 'data:数据@param:参数@both:全部'
          }, {
            name: '取值范围',
            code: 'rangeset',
            type: 'code'
          }, {
            name: '默认值',
            code: 'def_value',
            type: 'code'
          }, {
            name: '列表序号',
            code: 'listpos',
            type: 'integer'
          }, {
            name: '表单序号',
            code: 'cardpos',
            type: 'integer'
          }, {
            name: '备注',
            code: 'memo',
            type: 'memo'
          }, {
            name: '可编辑',
            code: 'editable',
            type: 'bool'
          }, {
            name: '必填',
            code: 'required',
            type: 'bool'
          }]
        }]
      }],
      actions: [{
        code: 'add',
        type: 'add',
        icon: 'android-list',
        name: '添加列表单据',
        param: {
          path_submit: '/service/{app}/bill/model',
          size: 'l'
        }
      }, {
        code: 'billView',
        type: 'billView',
        name: '预览',
        locate: 'inline',
        param: {
          path_find: '/service/{app}/bill/model/{code}',
          size: 'l',
          col: 2
        }
      }, {
        code: 'outputJson',
        type: 'outputJson',
        name: '导出',
        locate: 'inline',
        param: {
          path_find: '/service/{app}/bill/model/{code}',
          path_submit: '/service/{app}/bill/model',
          size: 'l',
          col: 2
        }
      }, {
        code: 'edit',
        type: 'edit',
        name: '编辑',
        locate: 'inline',
        param: {
          path_find: '/service/{app}/bill/model/{code}',
          path_submit: '/service/{app}/bill/model',
          size: 'l',
          col: 2
        }
      }, {
        code: 'delete',
        type: 'delete',
        path: '/service/{app}/bill/model',
        scope: 'rows',
        name: '删除'
      }]
    }
  }
  /*,{
     code: 'rm',
     name: '资源映射模型',
     model: {
       code: 'resource_mapping',
       path: '/service/{app}/dataset/data/db_resourcemapping',
       // bill_code: 'resource_mapping',
       name: '资源映射',
       fields: [{
         code: 'code',
         name: '编码',
         type: 'code',
         cardpos: 1
       }, {
         code: 'name',
         name: '名称',
         type: 'code',
         cardpos: 2
       }, {
         code: 'relation_code',
         name: '映射储存表',
         type: 'code',
         cardpos: 9
       }, {
         code: 'cacheable',
         name: '启用缓存',
         type: 'state',
         rangeset: '0:是@3:否',
         cardpos: 3
       }, {
         code: 'sortable',
         name: '可排序',
         type: 'stat',
         rangeset: '0:是@3:否',
         cardpos: 4
       }, {
         code: 'subject_id',
         name: '主体数据集',
         type: 'ref',
         cardpos: 5,
         rangeset: {
           path: '/service/{app}/bill/data/dataset/list'
         }
       }, {
         code: 'subject_tpl',
         name: '主体模板',
         type: 'code',
         cardpos: 6
       }, {
         code: 'resource_id',
         name: '资源数据集',
         type: 'ref',
         cardpos: 7,
         rangeset: {
           path: '/service/{app}/bill/data/dataset/list'
         }
       }, {
         code: 'resource_tpl',
         name: '资源模板',
         type: 'code',
         cardpos: 8
       }, {
         code: 'memo',
         name: '备注',
         type: 'memo',
         cardpos: 10
       }],
       actions: [{
         code: 'add',
         type: 'add',
         icon: 'android-list',
         name: '添加',
         param: {
           path_submit: '/service/{app}/bill/model',
           size: 'l',
           col: 2
         }
       }, {
         code: 'billView',
         type: 'billView',
         name: '预览',
         locate: 'inline',
         param: {
           path_find: '/service/{app}/bill/model/{code}',
           size: 'l',
           col: 2
         }
       }, {
         code: 'outputJson',
         type: 'outputJson',
         name: '导出',
         locate: 'inline',
         param: {
           path_find: '/service/{app}/bill/model/{code}',
           path_submit: '/service/{app}/bill/model',
           size: 'l',
           col: 2
         }
       }, {
         code: 'edit',
         type: 'edit',
         name: '编辑',
         locate: 'inline',
         param: {
           model: 'bill',
           path_find: '/service/{app}/bill/model/{code}',
           path_submit: '/service/{app}/bill/model',
           size: 'l',
           col: 2
         }
       }, {
         code: 'delete',
         type: 'delete',
         path: '/service/{app}/bill/model',
         scope: 'rows',
         name: '删除'
       }]
     }
   }*/
  ]
}
